package io.terminus.spzx.product.controller;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.terminus.spzx.model.entity.product.Brand;
import io.terminus.spzx.model.vo.common.Result;
import io.terminus.spzx.model.vo.common.ResultCodeEnum;
import io.terminus.spzx.product.service.BrandService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author lichunlong lcl253137@alibaba-inc.com
 * @desc 【移动端】品牌管理Controller
 * @date 2024-10-30
 */
@RestController
@Tag(name = "品牌管理接口")
@RequiredArgsConstructor
@RequestMapping(value = "/api/product/brand")
public class BrandController {

    private final BrandService brandService;

    @GetMapping("findAll")
    @Operation(summary = "查询全部品牌")
    public Result<List<Brand>> findAll() {
        List<Brand> list = brandService.findAll();

        return Result.build(list, ResultCodeEnum.SUCCESS);
    }

}
